home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / machack / Hacks97 / KlingonBGApp.sit / Klingon BG App / Source / mainUtil.c < prev    next >
Text File  |  1997-06-28  |  1KB  |  68 lines

  1. // Source code for Klingon Clock.   Copyright (C) 1996-1997
  2. // Charles H. Hemstreet IV
  3. //
  4. // Started at MacHack 1996
  5. // Completed at MacHack 1997
  6. //
  7. // Best thanks to:
  8. // My wife Regie, son Chad and baby
  9. // Other thanks to Elden Wood and Bob Clark
  10. //
  11. // This code is distributed "as-is" and implies no warranty or guarantee.
  12.  
  13.  
  14. #ifndef __MAINUTIL__
  15. #include "mainUtil.h"
  16. #endif
  17.  
  18.  
  19. void gestaltChecks(void)
  20. {
  21.     OSErr        initAppErr;
  22.     long        gestaltAnswer;
  23.     
  24.     initAppErr = Gestalt(gestaltVersion, &gestaltAnswer);
  25.     assert(initAppErr == noErr);
  26.  
  27.     if (initAppErr)
  28.     {
  29.         SysBeep(1);
  30.         ExitToShell();
  31.         // This program must run on a machine that is new enough to support the gestalt manager.
  32.     }
  33.     
  34.     initAppErr = Gestalt(gestaltSystemVersion, &gestaltAnswer);
  35.     assert(initAppErr == noErr);
  36.  
  37.     if (initAppErr) 
  38.     {
  39.         SysBeep(1);
  40.         ExitToShell();
  41.     }
  42.         
  43.     if (gestaltAnswer < 0x0700)
  44.     {
  45.         SysBeep(1);
  46.         ExitToShell();
  47.         // This program requires System 7.0 or higher to run",0,false,false,true);
  48.     }
  49. }
  50.  
  51.  
  52. OSErr DoAllPeriodicProcessing(void)
  53. {
  54.     short MySndID[kMaxArray];
  55.     short MySndID1[kMaxArray];
  56.     short MySndID2[kMaxArray];
  57.     short cur_time[kMaxArray];
  58.     OSErr myErr = noErr;
  59.     
  60.     getTime(cur_time);
  61.     myErr = makeSentence(cur_time, MySndID, MySndID1, MySndID2);
  62.     assert(myErr == noErr);
  63.     myErr = speakSentence(MySndID, MySndID1, MySndID2);
  64.     assert(myErr == noErr);
  65.     
  66.     return myErr;
  67. }
  68.